package com.hgxd.base;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @author: FSD
 * @Created 2023/11/20 18:16
 * @description
 **/
public class TreeNode {
    private Integer id;
    private Integer parentId;

    public List<TreeNode> getChildren() {
        return children;
    }

    public void setChildren(List<TreeNode> children) {
        this.children = children;
    }

    List<TreeNode> children = null;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public void add(TreeNode node){
        if(!children.contains(node)){
            children.add(node);
        }
    }
}

